package config_table

import (
	"config/item"
)

type exampleTable struct {
	Items map[int]*config_item.Example
}
type exampleConfig []*config_item.Example

var (
	Example = new(exampleTable)
)

func init() {
	register(Example.parse, new(exampleConfig), "example/example_config.json")
}

func (table *exampleTable) parse(records interface{}) (err error) {
	type Item = config_item.Example
	table.Items = make(map[int]*config_item.Example)
	for _, item := range *records.(*exampleConfig) {
		table.Items[item.Number] = item
	}

	return
}
